comment "This function adds an element to the end of an array and returns the array.";
comment "Example:";
comment "array = [1,2,3]";
comment "[array, 4] call ArrayPush";
comment "array2 = [[5,6,7], 8] call ArrayPush";
comment "array is now [1,2,3,4]";
comment "array2 is now [5,6,7,8]";

private["_value", "_size"];

_value = (_this select 1);

_size = count (_this select 0);

(_this select 0) resize (_size + 1);
(_this select 0) set[_size, _value];

_value = nil;
_size = nil;

(_this select 0)
